﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ApiBetaSeries;
using ApiBetaSeries.Factories;
using ApiBetaSeries.Services;

namespace TestApiBetaSeries
{
    class Program
    {
        static void Main(string[] args)
        {
            BetaSeriesConfig.ApiKey = "1330c9410051";

            // Enregistrement de l'utilisateur et récupération du token
            UserServices userServ = UserServices.GetInstance();
            string token = userServ.Auth("albator1932", "aspirin6");
            Console.WriteLine("Le token d'identification pour le compte albator1932 est " + token);
            
            ShowServices showServ = ShowServices.GetInstance();
            //Dictionary<string, string> shows = showServ.GetAllShows();
            //Console.WriteLine("Nombre de séries trouvées : " + shows.Count.ToString());
            Dictionary<string, string> showSearch = showServ.SearchShow("battlestar");
            Console.WriteLine("Nombre de séries comportant \"battlestar\" trouvées : " + showSearch.Count.ToString());
            foreach (KeyValuePair<string, string> kvp in showSearch)
            {
                Console.WriteLine("title = {0}, url = {1}", kvp.Key, kvp.Value);
            }




            Console.Read();
        }
    }
}
